package me.sdevil507.supports.shiro.token;

import me.sdevil507.supports.shiro.enums.LoginChannel;
import me.sdevil507.supports.shiro.enums.LoginModeType;

/**
 * 用户名/密码/角色验证token
 *
 * @author sdevil507
 */
public class UsernamePasswordToken extends BaseToken {

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    public UsernamePasswordToken(String username, String password, LoginChannel channel, LoginModeType model) {
        super(channel.name(), model.name());
        this.username = username;
        this.password = password;
    }

    @Override
    public Object getPrincipal() {
        return this.username;
    }

    @Override
    public Object getCredentials() {
        return this.password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}